package cn.yzgy.yzgyoa.ucenter.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.util.List;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 菜单表，用于储存系统中的菜单，权限等信息
 * </p>
 *
 * @author Yqsen
 * @since 2019-08-27
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_menu")
public class SysMenu extends Model<SysMenu> {

    private static final long serialVersionUID = 1L;

    /**
     * 菜单ID
     */
    @TableId(value = "mid", type = IdType.ID_WORKER)
    private Long mid;

    /**
     * 菜单标题
     */
    private String title;

    /**
     * 菜单链接
     */
    private String url;

    /**
     * 菜单图标
     */
    private String icon;

    /**
     * 菜单顺序
     */
    private Integer sort;

    /**
     * 上级菜单ID
     */
    private Long parentMid;

    /**
     * 菜单权限，只有拥有该权限的用户才能获取到该菜单
     */
    private Long permId;

    /**
     * 权限名
     */
    @TableField(exist = false)
    private String permVal;

    /**
     * 子菜单
     */
    @TableField(exist = false)
    private List<SysMenu> childs;


    @Override
    protected Serializable pkVal() {
        return null;
    }

}
